package com.le.tester.javaThink.fifth.chapter14_StreamingProgramming;

import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.StringReader;

/**
 * 描述：文本文件输出快捷方式
 */
public class FileOutputShortcut {
    static String file = "E:\\L.info\\L.Application\\L.Tester\\src\\main\\java\\com\\le\\tester\\java8\\chapter14_StreamingProgramming\\FileOutputShortcut.java";

    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new StringReader(
                BufferedInputFile.read("E:\\L.info\\L.Application\\L.Tester\\src\\main\\java\\com\\le\\tester\\java8\\chapter14_StreamingProgramming\\FileOutputShortcut.java")));
             PrintWriter out = new PrintWriter(file)) {
            in.lines().forEach(out::println);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        System.out.println(BufferedInputFile.read(file));
    }
}
